package com.dhcc.cdc.nlp.service.impl;

import java.util.List;
import java.util.Map;

import com.dhcc.core.framework.result.node.ZTreeNode;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.plugins.Page;
import com.dhcc.core.framework.base.service.impl.BaseServiceImpl;
import com.dhcc.cdc.nlp.dao.NlpSchemaDicMapper;
import com.dhcc.cdc.nlp.service.INlpSchemaDicService;
import com.dhcc.cdc.nlp.entity.NlpSchemaDicEntity;

/**
 * NLP标签字典表表数据服务层接口
 * 
 * @ClassName: NlpSchemaDicServiceImpl
 * @Description: TODO
 * @author sunyingjie
 * @date 2023-03-17 08:15:19
 */
@Service("nlpSchemaDicService")
public class NlpSchemaDicServiceImpl extends BaseServiceImpl<NlpSchemaDicMapper, NlpSchemaDicEntity> implements INlpSchemaDicService {

	@Override
	public List<NlpSchemaDicEntity> page(Page<NlpSchemaDicEntity> page, Map<String, Object> map) {
		return this.baseMapper.page(page, map);
	}
	@Override
	public List<NlpSchemaDicEntity> list(Map<String, Object> map) {
		return this.baseMapper.list(map);
	}

	@Override
	public List<ZTreeNode> getSchemaTree() {
		List<ZTreeNode> tree = this.baseMapper.tree();
		tree.add(ZTreeNode.createRoot("NLP标签"));
		return tree;
	}

	@Override
	public void deleteByParentId(Long nlpSchemaDicId) {
		this.baseMapper.deleteByParentId(nlpSchemaDicId);
	}
}